package net.hn.hnms.biz.power.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 智呈物联 pan'sx
 * 2022/9/20 10:24
 * 1.0 version
 */
@ApiModel("供电设备")
@Entity
@Table(name = "dwd_gdjk_base_deviceinfo", schema = "gdjk", catalog = "huaneng-production")
@Data
@JsonIdentityInfo(generator = ObjectIdGenerators.None.class, property = "deviceCode")
public class DeviceInfo {
    @ApiModelProperty("设备id")
    @Id
    private String deviceCode;

    @ApiModelProperty("设备名称")
    private String deviceName;

    @ApiModelProperty("规格型号")
    private String specificationMode;

    @ApiModelProperty("设备类别")
    private String deviceType;

    @ApiModelProperty("生产日期")
    @JsonFormat(
            pattern = "yyyy-MM-dd",
            timezone = "Asia/Shanghai"
    )
    private Date manufactureDate;

    @ApiModelProperty("所属系统")
    private String systemCode;

    @ApiModelProperty("安装日期")
    @JsonFormat(
            pattern = "yyyy-MM-dd",
            timezone = "Asia/Shanghai"
    )
    private Date installDate;

    @ApiModelProperty("安装位置")
    private String installLocation;

    @ApiModelProperty("生产厂家")
    private String manufacturer;

    @ApiModelProperty("出厂编码")
    private String factoryCode;

    @ApiModelProperty("安标证书编号")
    private String safetystandardCertificateNo;

    @ApiModelProperty("防爆证书编号")
    private String explosionproofCertificateNo;

    @ApiModelProperty("额定电压")
    private BigDecimal ratedVoltage;

    @ApiModelProperty("额定电流")
    private BigDecimal ratedCurrent;

    @ApiModelProperty("额定功率")
    private BigDecimal ratedPower;

    @ApiModelProperty("上传时间")
    @JsonFormat(
            pattern = "yyyy-MM-dd",
            timezone = "Asia/Shanghai"
    )
    private Date UploadTime;

    @ApiModelProperty("入库时间")
    @JsonFormat(
            pattern = "yyyy-MM-dd",
            timezone = "Asia/Shanghai"
    )
    private Date createTime;

    @ApiModelProperty("状态标识")
    private String dataFlag;

    @ApiModelProperty("煤矿编码")
    private String mineCode;

    @ApiModelProperty("排序号")
    private Integer sort;

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "deviceInfo")
    @ApiModelProperty(value = "测点信息")
    private List<SensorInfo> sensorInfos;

    @ApiModelProperty("a相电流变比")
    private BigDecimal iaRatio;
    @ApiModelProperty("c相电流变比")
    private BigDecimal icRatio;
    @ApiModelProperty("无功变比")
    private BigDecimal q_ratio;
    @ApiModelProperty("功率因素变比")
    private BigDecimal cosRatio;
    @ApiModelProperty("有功变比")
    private BigDecimal p_ratio;
    @ApiModelProperty("通讯量程")
    private BigDecimal communicationRange;
    @ApiModelProperty("二次量程")
    private BigDecimal secondaryRange;

}
